/**
 * 
 */
package org.swing.utility.jai.bean;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
/**
 * @author Quynh Nhu
 *
 */
public class Film {
	  private String id;

	  private short isoSpeedRating;

	  private String make;

	  private String model;

	  private byte numExposures;

	  private PropertyChangeSupport notifier = new PropertyChangeSupport(this);

	  public Film() {
	  }

	  public Film(final String make, final String model,
	    final short isoSpeedRating, final byte numExposures) {
	    this.make = make;
	    this.model = model;
	    this.isoSpeedRating = isoSpeedRating;
	    this.numExposures = numExposures;
	  }

	  public synchronized void addPropertyChangeListener(
	    final PropertyChangeListener listener) {
	    notifier.addPropertyChangeListener(listener);
	  }

	  public synchronized void addPropertyChangeListener(final String propertyName,
	    final PropertyChangeListener listener) {
	    notifier.addPropertyChangeListener(propertyName, listener);
	  }

	  public synchronized void removePropertyChangeListener(
	    final PropertyChangeListener listener) {
	    notifier.removePropertyChangeListener(listener);
	  }

	  public synchronized void removePropertyChangeListener(
	    final String propertyName, final PropertyChangeListener listener) {
	    notifier.removePropertyChangeListener(propertyName, listener);
	  }

	  /**
	   * @return
	   */
	  public String getId() {
	    return id;
	  }

	  /**
	   * @return
	   */
	  public short getIsoSpeedRating() {
	    return isoSpeedRating;
	  }

	  /**
	   * @return
	   */
	  public String getMake() {
	    return make;
	  }

	  /**
	   * @return
	   */
	  public String getModel() {
	    return model;
	  }

	  /**
	   * @return
	   */
	  public byte getNumExposures() {
	    return numExposures;
	  }

	  /**
	   * @param string
	   */
	  private void setId(final String id) {
	    String oldValue = this.id;
	    this.id = id;
	    notifier.firePropertyChange("id", oldValue, id);
	  }

	  /**
	   * @param s
	   */
	  public void setIsoSpeedRating(final short isoSpeedRating) {
	    short oldValue = this.isoSpeedRating;
	    this.isoSpeedRating = isoSpeedRating;
	    notifier.firePropertyChange("isoSpeedRating", oldValue, isoSpeedRating);
	  }

	  /**
	   * @param string
	   */
	  public void setMake(final String make) {
	    String oldValue = this.make;
	    this.make = make;
	    notifier.firePropertyChange("make", oldValue, make);
	  }

	  /**
	   * @param string
	   */
	  public void setModel(final String model) {
	    String oldValue = this.model;
	    this.model = model;
	    notifier.firePropertyChange("model", oldValue, model);
	  }

	  /**
	   * @param b
	   */
	  public void setNumExposures(final byte numExposures) {
	    byte oldValue = this.numExposures;
	    this.numExposures = numExposures;
	    notifier.firePropertyChange("numExposures", oldValue, numExposures);
	  }

	  public String toString() {
	    return make + " " + model + " ISO=" + isoSpeedRating + "  " + numExposures;
	  }
	}
